package com.springcloud.eshop.price.controller;

import com.springcloud.eshop.price.entity.ProductPrice;
import com.springcloud.eshop.price.service.ProductPriceService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 商品价格表(ProductPrice)表控制层
 *
 * @author makejava
 * @since 2020-06-29 06:22:02
 */
@RestController
@RequestMapping("productPrice")
public class ProductPriceController {
    /**
     * 服务对象
     */
    @Resource
    private ProductPriceService productPriceService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public ProductPrice selectOne(Long id) {
        return this.productPriceService.queryById(id);
    }

    @GetMapping("/insert")
    public ProductPrice insert(ProductPrice brand) {
        return this.productPriceService.insert(brand);
    }

    @GetMapping("/update")
    public ProductPrice update(ProductPrice brand) {
        return this.productPriceService.update(brand);
    }

    @GetMapping("/delete")
    public boolean deleteById(long id) {
        return this.productPriceService.deleteById(id);
    }
}